import { Injectable } from '@angular/core';
import { Http , Response } from '@angular/http';
import { Slider } from '../models/slider-model';
import { Observable } from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';

@Injectable()
export class ImageSlidersService {

    private slidersdataurl = 'src/app/mock-data/slidersdata.json';

    constructor(public httpService: Http) {

    }

    public getRemoteSliders(): Observable<Slider[]> {
         return this.httpService.get(this.slidersdataurl)
            .map((res: Response) => res.json());
    }

}